# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pyname=tasklib
pkgname=python-${_pyname}
pkgver=2.5.1
pkgrel=2
pkgdesc='Python library for interacting with taskwarrior databases'
url='http://tasklib.readthedocs.org/en/latest/'
arch=('any')
license=('BSD')
depends=('python')
makedepends=('python-setuptools' 'python-sphinx')
source=("https://github.com/GothenburgBitFactory/tasklib/archive/$pkgver.tar.gz")
sha512sums=('b52a94e487eb90776a5edec63bfef9a4eaa5a87065be3a5386bd0d8b277b88fb35663ea5789e573a088e54fb9aa835c27d787fced4ed5198badff995dcc2e7e0')
b2sums=('7ca8fa519ccfb8f1fdfe06536f825f488766abcfd2e7c8c722b1dad8ecf51ea8846c93baac7207b607e50bb8285f9a0b88ba9116ca2285a1e012a053600ff8f5')

build() {
  cd ${_pyname}-${pkgver}
  python setup.py build
  export PYTHONPATH=..
  make -C docs text man
}

package() {
  cd ${_pyname}-${pkgver}
  python setup.py install --root="${pkgdir}" -O1 --skip-build
  install -Dm 644 docs/_build/man/${_pyname}.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
  install -Dm 644 docs/_build/text/* -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
